#include<iostream>
#include<set>
#include<unordered_set>
using namespace std;

class Solution {
public:
    bool strongPasswordCheckerII(string password) {
        int ans = 32;
        if (password.length() >= 8) {
            ans |= 1;
        }
        unordered_set<char> st = {'!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '-', '+'};
        for (int i = 0; i < password.length(); i++) {
            if (password[i] <= 'z' && password[i] >= 'a') {
                ans |= 2;
            }
            if (password[i] <= 'Z' && password[i] >= 'A') {
                ans |= 4;
            }
            if (password[i] <= '9' && password[i] >= '0') {
                ans |= 8; 
            }
            if (st.count(password[i])) {
                ans |= 16;
            }
            if (i > 0 && password[i] == password[i - 1]) {
                ans &= 31;
            }
        }
        return ans == 63;
    }
};

int main() {
    return 0;
}

/**
 * 2023.1.19
 * 字符这么少就 tm 别用那复杂的数据结构了，直接字符数组得了
*/